<template>
    <div>
        <template>
            <el-page-header style="background-color: #0095d7;color: white;line-height: 60px"
                            @back="goReturn" content="咨讯详情页面"></el-page-header>

            <el-divider></el-divider>

            <el-card>
                <el-form>
                    <el-form-item prop="id" label="序号" label-width="80px">
                        <el-input v-model="information.id"></el-input>
                    </el-form-item>

                    <el-form-item prop="title" label="标题" label-width="80px">
                        <el-input v-model="information.title"></el-input>
                    </el-form-item>

                    <el-form-item prop="img" label="图片" label-width="80px">
                        <el-image
                                style="width: 100px; height: 100px"
                                :src="'http://176.17.10.223:18082/' + information.img"
                        ></el-image>
                    </el-form-item>



                    <el-form-item prop="content" label="正文" label-width="80px">
                        <el-input v-model="information.content"></el-input>
                    </el-form-item>

                    <el-form-item prop="gmtCreate" label="创建时间" label-width="80px">
                        <el-input v-model="information.gmtCreate"></el-input>
                    </el-form-item>


                </el-form>
            </el-card>
        </template>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                id: this.$route.query.id,
                information: {
                    id:"",
                    title:"",
                    img:"",
                    content:"",
                    gmtCreate:"",
                    gmtModified:"",
                },
            }
        },
        created() {
            this.getData();
        },

        methods: {

            // 记录选择的数据
            handleSelectionChange(vals) {
                this.multipleSelection = vals;
            },
            getData(){
                let url = 'http://176.17.10.223:18082/information/selectById';
                let data = 'id=' + this.id;
                console.log(url)
                console.log("id=============" + this.id)
                console.log(data)
                this.axios.post(url,data).then( (response)=> {
                    // 将得到的用户数据存储起来
                    this.information = response.data.data;
                    console.log("data=========" + response.data.data)

                })
            },

            goReturn(){
                //返回上一页面
                history.back();
            }
        }
    }
</script>

<style scoped>

</style>